package com.virtium.vpm.form;

import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import com.virtium.vpm.controller.TypeManager;
import com.virtium.vpm.controller.UserManager;
import com.virtium.vpm.controller.UserSession;
import com.virtium.vpm.hibernate.model.Type;
import com.virtium.vpm.hibernate.model.User;


public class ProjectForm extends ActionForm {
	protected Integer id;
	protected Integer typeId;
	protected String email;
	protected String archive;
	protected ArrayList<String> projectList = new ArrayList<String>();
	protected ArrayList<Type> projectTypeCol = new ArrayList<Type>();
	protected ArrayList<User> userCol = new ArrayList<User>();
	protected UserSession userSession = new UserSession();
	protected String userList;
	
	// Constructors	

	/**
	 * Method reset
	 * 
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		
	}
	
	/** default constructor */
	public ProjectForm() {
		System.out.println("sdd");
	}

	/** full constructor */
	public ProjectForm(Integer typeId, String email, String archive) {
		this.typeId = typeId;
		this.email = email;
		this.archive = archive;
	}

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getTypeId() {
		return this.typeId;
	}

	public void setTypeId(Integer typeId) {
		this.typeId = typeId;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getArchive() {
		return this.archive;
	}

	public void setArchive(String archive) {
		this.archive = archive;
	}
	
	public ArrayList<String> getProjectList() {
		return projectList;
	}

	public void setProjectList(ArrayList<String> projectList) {
		this.projectList = projectList;
	}
	
	
	public String getUserList() {
		userList = UserManager.getAllStringUser(); 
		return userList;
	}

	public void setUserList(String userList) {
		this.userList = userList;
	}
	
	public ArrayList<Type> getProjectTypeCol() {
		projectTypeCol = TypeManager.getAllTypes();
		return projectTypeCol;
	}

	public void setProjectTypeCol(ArrayList<Type> projectTypeCol) {
		this.projectTypeCol = projectTypeCol;
	}
	
	public ArrayList<User> getUserCol() {
		userCol = UserManager.getAllUser();
		return userCol;
	}

	public void setUserCol(ArrayList<User> userCol) {
		this.userCol = userCol;
	}
	
	public UserSession getUserSession() {
		if(userSession == null) userSession = new UserSession();
		return userSession;
	}

	public void setUserSession(UserSession userSession) {
		this.userSession = userSession;
	}
}
